#ifndef SG_RAND_H_INCLUDED
#define SG_RAND_H_INCLUDED

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

/* A pseudo random number generator by Bob Jenkins */
/* He placed it in the public domain */
/* I (sg) only tweaked the syntax */

struct randctx {
	uint32_t a, b, c, d;
};

extern uint32_t randval(struct randctx *x);

extern void randinit(struct randctx *x, uint32_t seed);

#ifdef __cplusplus
}
#endif

#endif
